require("../../assets/css/basic.less");
require("../../assets/css/normalize.css");
require("../../assets/css/property.css");
require("../../assets/css/reset.css");
// 引入当前页面css样式
require("../countdown/countdown.less");
require("../../libs/dom.js");
//引入节点
const dom = require("../../libs/dom.js");

document.addEventListener("DOMContentLoaded", function () {
	// 第一种方法
	let num = 3;
	const timer = window.setInterval(function () {
		num--;
		dom.get("#countdown").textContent = num;
		if (num === 0) {
			clearInterval(timer);
			dom.get("#countdown").textContent = "GO";
			window.setTimeout(function () {
				location.href = "./sporting.html";
			}, 1000);
		}
	}, 1000);
	/*
	// 第二种方法
	let num = 3;
	const timer = window.setInterval(function () {
		num--;
		dom.get("#countdown").textContent = num;
		if (num === 0) {
			dom.get("#countdown").textContent = "GO";
		} else if (num === -1) {
			clearInterval(timer);
			dom.get("#countdown").textContent = "";
			location.href = "./sporting.html";
		}
	}, 1000);
	*/
});
